package com.androidmvc.base.network;

import com.androidmvc.base.network.http.HTTPFactory;
import com.androidmvc.base.network.http.okhttp.HttpCycleContext;
import com.androidmvc.base.network.http.okhttp.HttpRequestCallback;
import com.androidmvc.base.network.http.okhttp.RequestParams;

/**
 * 网络请求接口
 *
 * @author: jmh
 * @function:
 * @date: 16/8/12
 */
public class RequestCenter {


    /**
     * 用户登录
     *
     * @param cycleContext
     * @param userName
     * @param passwd
     * @param listener
     */
    public static void login(HttpCycleContext cycleContext, String userName, String passwd, HttpRequestCallback listener) {
        RequestParams params = new RequestParams(cycleContext);
        params.addFormDataPart("username", userName);
        params.addFormDataPart("password", passwd);
        HTTPFactory.postRequest(HttpConstants.LOGIN, params, listener);
    }

}
